import { request, config } from 'utils'

const { api } = config
const { permissionsAll, permissionsList, permissionsListAll, permissionsAdd, permissionsEdit, permissionsQuery, permissionsDel, permissionsMultiDel } = api

export async function list (params) {
  return request({
    url: permissionsList,
    method: 'post',
    data: params,
  })
}

// 获取所有permission列表
export async function queryAll() {
  return request({
    url: permissionsAll,
    method: 'post'
  })
}

export async function listall (params) {
  return request({
    url: permissionsListAll,
    method: 'post',
    data: params,
  })
}

export async function query (params) {
  return request({
    url: permissionsQuery,
    method: 'put',
    data: params,
  })
}


export async function create (params) {
  return request({
    url: permissionsAdd,
    method: 'post',
    data: params,
  })
}

export async function update (params) {
  return request({
    url: permissionsEdit,
    method: 'put',
    data: params,
  })
}
export async function remove (params) {
  return request({
    url: permissionsDel,
    method: 'delete',
    data: params,
  })
}

export async function patchremove (params) {
  return request({
    url: permissionsMultiDel,
    method: 'delete',
    data: params,
  })
}


